﻿namespace NEATlib
{
    public static class TimeSeriesDataProvider
    {
        private static readonly TimeSeriesDataCollection Data = new TimeSeriesDataCollection();

        public static DataCollection GetCollection(NeuralNetworkInfo info)
        {
            if (Data.SamplesCount <= 0)
            Data.LoadLearnData("EURUSD_101002_101006.csv", info.InputCount);
            return Data;
        }

        public static DataCollection GetTestCollection(NeuralNetworkInfo nninfo)
        {
            if (Data.SamplesCount <= 0)
            {
                Data.LoadTestData("EURUSD_101002_101006.csv", nninfo.InputCount);
                return Data;
            }
                return Data.GetPart((int)(0.8*Data.SamplesCount), Data.SamplesCount-1);
        }
    }
}
